﻿package mortal.game.view.vip.panel
{
    import Message.DB.Tables.*;
    import Message.Game.*;
    import Message.Public.*;
    import __AS3__.vec.*;
    import baseEngine.modifiers.*;
    import com.gengine.global.*;
    import com.gengine.resource.*;
    import com.greensock.*;
    import com.greensock.easing.*;
    import com.mui.controls.*;
    import com.mui.core.*;
    import com.mui.display.*;
    import com.mui.utils.*;
    import extend.language.*;
    import fl.data.*;
    import flash.display.*;
    import flash.events.*;
    import flash.geom.*;
    import frEngine.*;
    import frEngine.core.mesh.*;
    import frEngine.effectEditTool.temple.*;
    import frEngine.pools.*;
    import frEngine.primitives.object2d.*;
    import mortal.common.*;
    import mortal.common.display.*;
    import mortal.common.global.*;
    import mortal.common.net.*;
    import mortal.component.gconst.*;
    import mortal.component.window.*;
    import mortal.game.cache.*;
    import mortal.game.events.*;
    import mortal.game.manager.*;
    import mortal.game.manager.window3d.*;
    import mortal.game.mvc.*;
    import mortal.game.resource.*;
    import mortal.game.resource.info.item.*;
    import mortal.game.resource.tableConfig.*;
    import mortal.game.scene3D.model.data.*;
    import mortal.game.scene3D.model.player.*;
    import mortal.game.scene3D.model.player.weapon.*;
    import mortal.game.scene3D.model.pools.*;
    import mortal.game.scene3D.player.*;
    import mortal.game.scene3D.player.entity.*;
    import mortal.game.scene3D.player.type.*;
    import mortal.game.utils.*;
    import mortal.game.view.common.*;
    import mortal.game.view.common.display.*;
    import mortal.game.view.common.item.*;
    import mortal.game.view.firstReCharge.*;
    import mortal.game.view.forging.data.*;
    import mortal.game.view.palyer.data.*;
    import mortal.game.view.vip.*;
    import mortal.game.view.wizard.data.*;
    import mortal.mvc.core.*;

    public class VipLevelInfoPanel extends GSprite
    {
        private var _packTabData:Array;
        private var _itemList:Vector.<EffectItem>;
        private var _dailyList:Vector.<EffectItem>;
        private var _picList:Vector.<VipPictureBox>;
        private var _vip3DModelConfig:TVip;
        private var _vip3DBg:GImageBitmap;
        private var _vipLevelIcon1:BitmapNumberText;
        private var _vipLevelIcon2:BitmapNumberText;
        private var _vipLevelIcon3:BitmapNumberText;
        private var _prizeTxt1:GTextFiled;
        private var _prizeTxt2:GTextFiled;
        private var _addComabte:BitmapNumberText;
        private var _combatBg:GImageBitmap;
        private var _tabBar:GTileList;
        private var _picSprite:GSprite;
        private var _itemSprite:GSprite;
        private var _getRewardBtn:GButton;
        private var _dailyItemBtn:GButton;
        private var _descBtn:GTextFiled;
        private var _vipCompaireBtn:GTextFiled;
        private var _3dName:GTextFiled;
        private var _desc:GTextFiled;
        private var _levelRewardItem:BaseItem;
        private var _dailyRewardItem:BaseItem;
        private var _3dDescItem:EffectItem;
        private var _currentIndex:int = -1;
        private var _window:Window;
        private var _3dRotationSp:GSprite;
        private var _3dRotationBm:GBitmap;
        protected var _img2d:Img2D;
        protected var _rect3d:Rect3DObject;
        protected var _bodyPlayer:Md5Mesh;
        protected var _mesPlayer:MeshPlayer;
        protected var _hangPlayer:ActionPlayer;
        protected var _roleModelPlayer:UserModelPlayer;
        protected var _effectPlayer:EffectPlayer;
        protected var _effectList:Vector.<EffectPlayer>;
        private var timerContorler:TimeControler;
        private var _startX:Number;
        private var _endX:Number;
        private var tween:TweenMax;
        private var turnNum:Number = 0;
        private var _maskBitmap:ScaleBitmap;

        public function VipLevelInfoPanel(param1:Window)
        {
            this._itemList = new Vector.<EffectItem>;
            this._dailyList = new Vector.<EffectItem>;
            this._picList = new Vector.<VipPictureBox>;
            this._vip3DModelConfig = VipConfig.instance.getVipConfigByType(EVipRecordType._EVipRecordType3DDesc);
            this._effectList = new Vector.<EffectPlayer>;
            this._window = param1;
            this.timerContorler = TimeControler.createTimerInstance();
            this.timerContorler.unActive();
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._3dRotationSp = UICompomentPool.getUICompoment(GSprite);
            this._3dRotationSp.x = 270;
            this._3dRotationSp.y = 251;
            Global.stage.addEventListener(MouseEvent.MOUSE_DOWN, this.startTurn);
            Global.stage.addEventListener(MouseEvent.MOUSE_UP, this.stopTurn);
            this._3dRotationSp.mouseEnabled = true;
            this._3dRotationBm = GlobalClass.getBitmap(BitmapDataConst.AlphaBMD);
            this._3dRotationBm.width = 257;
            this._3dRotationBm.height = 300;
            this._3dRotationSp.addChild(this._3dRotationBm);
            this._window.contentTopOf3DSprite.addChild(this._3dRotationSp);
            this._vip3DBg = UIFactory.gImageBitmap(ImagesConst.Vip3DBg, 0, 0, null, this.add2dImage);
            var _loc_1:* = GlobalStyle.textFormatBai;
            this._prizeTxt1 = UIFactory.gTextField(Language.getString(35588), 725, 300, 120, 20, this._window.contentTopOf3DSprite, _loc_1);
            this._prizeTxt2 = UIFactory.gTextField(Language.getString(35588), 725, 475, 120, 20, this._window.contentTopOf3DSprite, _loc_1);
            _loc_1 = GlobalStyle.textFormatItemGreen;
            this.pushUIToDisposeVec(UIFactory.gTextField(Language.getString(35589), 760, 427, 120, 20, this._window.contentTopOf3DSprite, _loc_1));
            this.pushUIToDisposeVec(UIFactory.gBitmap(ImagesConst.Yuanbao, 835, 300, this._window.contentTopOf3DSprite));
            this.pushUIToDisposeVec(UIFactory.gBitmap(ImagesConst.Yuanbao, 835, 475, this._window.contentTopOf3DSprite));
            this.pushUIToDisposeVec(UIFactory.gBitmap(ImagesConst.deleteLine, 805, 307, this._window.contentTopOf3DSprite));
            this.pushUIToDisposeVec(UIFactory.gBitmap(ImagesConst.deleteLine, 805, 482, this._window.contentTopOf3DSprite));
            this.pushUIToDisposeVec(UIFactory.gImageBitmap(ImagesConst.VipPanelRewardTitleBg, 282, 200, this._window.contentTopOf3DSprite));
            this._tabBar = UIFactory.tileList(10, 169, 900, 42, this._window.contentTopOf3DSprite);
            this._tabBar.columnWidth = 89;
            this._tabBar.rowHeight = 41;
            this._tabBar.horizontalGap = -2.9;
            this._tabBar.verticalGap = 5;
            this._tabBar.setStyle("cellRenderer", VipTabCellRenderer);
            this._tabBar.dataProvider = this.getDataProvider();
            this._tabBar.configEventListener(Event.CHANGE, this.tabBarChangeHandler);
            _loc_1 = GlobalStyle.textFormatItemGreen.center();
            _loc_1.size = 13;
            _loc_1.underline = true;
            this._descBtn = UIFactory.gTextField("", 30, 566, 160, 40, this._window.contentTopOf3DSprite, _loc_1);
            this._descBtn.configEventListener(MouseEvent.CLICK, this.changePrivilegeShow);
            this._vipCompaireBtn = UIFactory.gTextField(Language.getString(35590), 208, 566, 55, 40, this._window.contentTopOf3DSprite, _loc_1);
            this._vipCompaireBtn.configEventListener(MouseEvent.CLICK, this.changePrivilegeShow);
            this._desc = UIFactory.gTextField("", 30, 250, 225, 313, this._window.contentTopOf3DSprite, GlobalStyle.textFormatBai);
            this._desc.visible = false;
            this._desc.multiline = true;
            this._desc.wordWrap = true;
            _loc_1 = GlobalStyle.textFormatBai.center();
            _loc_1.size = 18;
            this._3dName = UIFactory.gTextField("", 445 - 68, 240, 150, 35, this._window.contentTopOf3DSprite, _loc_1);
            this._vipLevelIcon1 = UIFactory.bitmapNumberText(106, 216, "VipLevelNum.png", 17, 20, -7, this._window.contentTopOf3DSprite, 9);
            this._vipLevelIcon2 = UIFactory.bitmapNumberText(659, 256, "VipLevelNum.png", 17, 20, -7, this._window.contentTopOf3DSprite, 9);
            this._vipLevelIcon3 = UIFactory.bitmapNumberText(659, 424, "VipLevelNum.png", 17, 20, -7, this._window.contentTopOf3DSprite, 9);
            this._addComabte = UIFactory.bitmapNumberText(128 + 428, 10 + 215, "GuildCopyNum.png", 24, 32, -6, this._window.contentTopOf3DSprite, 9, BitmapNumberText.Mid);
            this._combatBg = UIFactory.gImageBitmap("", 500, 220, this._window.contentTopOf3DSprite);
            this._combatBg.visible = false;
            this._getRewardBtn = UIFactory.gButton(Language.getString(35591), 750, 336, 84, 27, this._window.contentTopOf3DSprite, "RedButton");
            this._getRewardBtn.configEventListener(MouseEvent.CLICK, this.getItems);
            this._dailyItemBtn = UIFactory.gButton(Language.getString(35591), 750, 506, 84, 27, this._window.contentTopOf3DSprite, "RedButton");
            this._dailyItemBtn.configEventListener(MouseEvent.CLICK, this.getItems);
            this._maskBitmap = UIFactory.bg(5, 220, 260, 520);
            this._picSprite = UICompomentPool.getUICompoment(GSprite);
            this._window.contentTopOf3DSprite.addChild(this._picSprite);
            this._itemSprite = UICompomentPool.getUICompoment(GSprite);
            this._levelRewardItem = UICompomentPool.getUICompoment(BaseItem);
            this._levelRewardItem.setItemStyle(ItemStyleConst.Big, null);
            this._levelRewardItem.isShowLock = true;
            this._levelRewardItem.move(637, 294);
            this._itemSprite.addChild(this._levelRewardItem);
            this._dailyRewardItem = UICompomentPool.getUICompoment(BaseItem);
            this._dailyRewardItem.setItemStyle(ItemStyleConst.Big, null);
            this._dailyRewardItem.isShowLock = true;
            this._dailyRewardItem.move(638, 225 + 238);
            this._itemSprite.addChild(this._dailyRewardItem);
            this._3dDescItem = UICompomentPool.getUICompoment(EffectItem);
            this._3dDescItem.setItemStyle(ItemStyleConst.Small, null);
            this._3dDescItem.move(314, 232);
            this._window.contentTopOf3DSprite.addChild(this._3dDescItem);
            this.createItemList();
            this.createVipPic();
            this._currentIndex = this._currentIndex > 0 ? (this._currentIndex) : (Cache.instance.vip.level > 0 ? ((Cache.instance.vip.level - 1)) : (0));
            this._tabBar.selectedIndex = this._currentIndex;
            this.updeteVipLevel();
            LoaderHelp.addResCallBack(ResFileConst.vipPanel, this.showSkin);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            Global.stage.removeEventListener(MouseEvent.MOUSE_DOWN, this.startTurn);
            Global.stage.removeEventListener(MouseEvent.MOUSE_UP, this.stopTurn);
            if (this.tween && this.tween.active)
            {
                this.tween.kill();
            }
            this.remove3dPlayer();
            if (this._rect3d)
            {
                Rect3DManager.instance.disposeRect3d(this._rect3d);
                this._rect3d = null;
            }
            this._combatBg.dispose(param1);
            this._combatBg = null;
            this._prizeTxt1.dispose(param1);
            this._prizeTxt1 = null;
            this._prizeTxt2.dispose(param1);
            this._prizeTxt2 = null;
            this._levelRewardItem.dispose(param1);
            this._levelRewardItem = null;
            this._dailyRewardItem.dispose(param1);
            this._dailyRewardItem = null;
            this._tabBar.dispose(param1);
            this._tabBar = null;
            this._vipLevelIcon1.dispose(param1);
            this._vipLevelIcon1 = null;
            this._vipLevelIcon2.dispose(param1);
            this._vipLevelIcon2 = null;
            this._getRewardBtn.dispose(param1);
            this._getRewardBtn = null;
            this._dailyItemBtn.dispose(param1);
            this._dailyItemBtn = null;
            this._vipLevelIcon3.dispose(param1);
            this._vipLevelIcon3 = null;
            this._descBtn.dispose(param1);
            this._descBtn = null;
            this._desc.dispose(param1);
            this._desc = null;
            this._picSprite.mask = null;
            this._maskBitmap.dispose(param1);
            this._maskBitmap = null;
            this._picSprite.dispose(param1);
            this._picSprite = null;
            this._itemSprite.dispose(param1);
            this._itemSprite = null;
            this._vip3DBg.dispose(param1);
            this._vip3DBg = null;
            this._vipCompaireBtn.dispose(param1);
            this._vipCompaireBtn = null;
            this._3dName.dispose(param1);
            this._3dName = null;
            this._addComabte.dispose(param1);
            this._addComabte = null;
            this._3dDescItem.dispose(param1);
            this._3dDescItem = null;
            this._3dRotationSp.dispose(param1);
            this._3dRotationBm.dispose(param1);
            this._3dRotationSp = null;
            this._3dRotationBm = null;
            this.clearDailyItem();
            this._itemList.length = 0;
            this._picList.length = 0;
            super.disposeImpl(param1);
            return;
        }// end function

        private function showSkin() : void
        {
            if (isDisposed)
            {
                return;
            }
            this.pushUIToDisposeVec(UIFactory.gBitmap(ImagesConst.VipTitleTxt, 80, 216, this._window.contentTopOf3DSprite));
            this.pushUIToDisposeVec(UIFactory.gBitmap(ImagesConst.VipTitleTxt, 632, 256, this._window.contentTopOf3DSprite));
            this.pushUIToDisposeVec(UIFactory.gBitmap(ImagesConst.VipTitleTxt, 632, 424, this._window.contentTopOf3DSprite));
            this._window.contentTopOf3DSprite.addChild(this._itemSprite);
            this._window.contentTopOf3DSprite.addChild(this._addComabte);
            this.tabBarChangeHandler();
            return;
        }// end function

        private function remove3dPlayer() : void
        {
            var _loc_1:EffectPlayer = null;
            if (this._bodyPlayer)
            {
                this.timerContorler.unActive();
                if (this._bodyPlayer is ActionPlayer)
                {
                    (this._bodyPlayer as ActionPlayer).unHang(this._bodyPlayer as ActionPlayer);
                }
                this._rect3d.disposeObj3d(this._bodyPlayer);
                this._bodyPlayer = null;
            }
            if (this._roleModelPlayer)
            {
                this._rect3d.disposeObj3d(this._roleModelPlayer);
                this._roleModelPlayer = null;
            }
            if (this._hangPlayer)
            {
                this._rect3d.disposeObj3d(this._hangPlayer);
                this._hangPlayer = null;
            }
            if (this._effectPlayer)
            {
                this._rect3d.disposeObj3d(this._effectPlayer);
                this._effectPlayer = null;
            }
            if (this._mesPlayer)
            {
                this._rect3d.disposeObj3d(this._mesPlayer);
                this._mesPlayer = null;
            }
            for each (_loc_1 in this._effectList)
            {
                
                this._rect3d.disposeObj3d(_loc_1);
            }
            this._effectList.length = 0;
            return;
        }// end function

        private function startTurn(event:MouseEvent) : void
        {
            this._startX = this.mouseX;
            this._3dRotationSp.configEventListener(MouseEvent.MOUSE_MOVE, this.turning);
            return;
        }// end function

        private function stopTurn(event:MouseEvent) : void
        {
            this._3dRotationSp.removeEventListener(MouseEvent.MOUSE_MOVE, this.turning);
            return;
        }// end function

        private function turning(event:MouseEvent) : void
        {
            this._endX = this.mouseX;
            if (this._bodyPlayer)
            {
                this._bodyPlayer.rotationY = this._bodyPlayer.rotationY - (this._endX - this._startX) / 2;
            }
            if (this._roleModelPlayer)
            {
                this._roleModelPlayer.rotationY = this._roleModelPlayer.rotationY - (this._endX - this._startX) / 2;
            }
            this._startX = this._endX;
            return;
        }// end function

        protected function add3d() : void
        {
            this._rect3d = Rect3DManager.instance.registerWindow(true, new Rectangle(11, 167, 882, 438), this._window);
            Rect3DManager.instance.windowShowHander(null, this._window);
            return;
        }// end function

        protected function add2dImage() : void
        {
            var _loc_1:BitmapData = null;
            if (this.isDisposed)
            {
                return;
            }
            this.add3d();
            if (this._rect3d)
            {
                _loc_1 = this._vip3DBg.bitmapData;
                this._img2d = new Img2D(null, _loc_1, new Rectangle(0, 0, 882, 438), false);
                this._rect3d.addImg(this._img2d);
            }
            this.update3DModel();
            return;
        }// end function

        protected function update3DModel() : void
        {
            var _loc_1:Array = null;
            var _loc_2:Array = null;
            var _loc_3:int = 0;
            var _loc_4:String = null;
            var _loc_5:String = null;
            var _loc_6:String = null;
            var _loc_7:* = undefined;
            var _loc_8:int = 0;
            var _loc_9:ItemData = null;
            var _loc_10:int = 0;
            var _loc_11:Number = NaN;
            var _loc_12:Boolean = false;
            var _loc_13:int = 0;
            var _loc_14:int = 0;
            var _loc_15:int = 0;
            var _loc_16:int = 0;
            var _loc_17:TModel = null;
            var _loc_18:WizardData = null;
            var _loc_19:int = 0;
            var _loc_20:ItemEquipInfo = null;
            var _loc_21:EffectPlayer = null;
            var _loc_22:int = 0;
            var _loc_23:TTitle = null;
            var _loc_24:TSkill = null;
            var _loc_25:TSkillModel = null;
            var _loc_26:int = 0;
            var _loc_27:TMountConfig = null;
            var _loc_28:Point = null;
            var _loc_29:int = 0;
            var _loc_30:FashionAdvanceData = null;
            var _loc_31:int = 0;
            var _loc_32:int = 0;
            var _loc_33:TPlayerModel = null;
            if (this._rect3d)
            {
                _loc_1 = (this._vip3DModelConfig["vip" + (this._tabBar.selectedIndex + 1)] as String).split("#");
                _loc_2 = (_loc_1[1] as String).split("&");
                _loc_3 = _loc_1[0];
                if (_loc_1[2])
                {
                    this._3dName.text = _loc_1[2];
                }
                if (int(_loc_1[3]) > 0)
                {
                    this._addComabte.text = _loc_1[3];
                    this._combatBg.visible = true;
                    this._3dName.x = 445 - 68;
                    this._combatBg.imgUrl = ImagesConst.VipAddCombatBg;
                }
                else if (int(_loc_1[3]) == 0)
                {
                    this._combatBg.visible = true;
                    this._combatBg.imgUrl = _loc_1[3];
                    this._addComabte.text = "";
                    this._3dName.x = 445 - 68 - 20;
                }
                else if (int(_loc_1[3]) < 0)
                {
                    this._addComabte.text = "";
                    this._combatBg.visible = false;
                    this._3dName.x = 445 - 68;
                    this._combatBg.imgUrl = ImagesConst.VipAddCombatBg;
                }
                if (_loc_1[4])
                {
                    this._3dDescItem.itemData = new ItemData(int(_loc_1[4]));
                    this._3dDescItem.showEffect(true, 220, 220, "ArroundEffect_cheng_small.swf");
                }
                _loc_12 = _loc_1[5] == "1";
                _loc_11 = int(_loc_1[6]) * 0.01;
                _loc_10 = _loc_1[7];
                if (_loc_2)
                {
                    _loc_8 = _loc_2[0];
                }
                else
                {
                    _loc_8 = int(_loc_1[1]);
                }
                _loc_9 = new ItemData(_loc_8);
                if (this._bodyPlayer)
                {
                    if (this._bodyPlayer is WizardActionPlayer)
                    {
                        (this._bodyPlayer as WizardActionPlayer).clearExtend();
                        this.timerContorler.unActive();
                    }
                    if (this._bodyPlayer is ActionPlayer)
                    {
                        (this._bodyPlayer as ActionPlayer).unHang(this._bodyPlayer as ActionPlayer);
                    }
                    this._rect3d.disposeObj3d(this._bodyPlayer);
                }
                this.remove3dPlayer();
                switch(_loc_3)
                {
                    case VipModelConst.Chlose:
                    {
                        _loc_7 = PlayerModelConfig.instance.getModelInfo(ModelType.CLOTHES, (_loc_9.itemInfo as ItemEquipInfo).modelId, Cache.instance.role.entityInfo.sex, Cache.instance.role.entityInfo.career);
                        _loc_4 = _loc_7.mesh + ".md5mesh";
                        _loc_5 = _loc_7.bone + ".skeleton";
                        _loc_6 = _loc_7.texture;
                        break;
                    }
                    case VipModelConst.Wing:
                    {
                        _loc_7 = PlayerModelConfig.instance.getModelInfo(ModelType.WING, (_loc_9.itemInfo as ItemEquipInfo).modelId, Cache.instance.role.entityInfo.sex, Cache.instance.role.entityInfo.career);
                        _loc_4 = _loc_7.mesh + ".md5mesh";
                        _loc_5 = _loc_7.bone + ".skeleton";
                        _loc_6 = _loc_7.texture;
                        break;
                    }
                    case VipModelConst.Weapon:
                    {
                        _loc_7 = PlayerModelConfig.instance.getModelInfo(ModelType.WEAPONS, (_loc_9.itemInfo as ItemEquipInfo).modelId, Cache.instance.role.entityInfo.sex, Cache.instance.role.entityInfo.career);
                        _loc_4 = _loc_7.mesh + ".md5mesh";
                        _loc_5 = _loc_7.bone + ".skeleton";
                        _loc_6 = _loc_7.texture;
                        break;
                    }
                    case VipModelConst.Headdress:
                    {
                        break;
                    }
                    case VipModelConst.Sprite:
                    {
                        _loc_18 = new WizardData(_loc_9.itemInfo.effect);
                        _loc_7 = ModelConfig.instance.getInfoByCode(int(_loc_18.tSprite.modelId));
                        _loc_4 = _loc_7.mesh1 + ".md5mesh";
                        _loc_5 = _loc_7.bone1 + ".skeleton";
                        _loc_6 = _loc_7.texture1;
                        break;
                    }
                    case VipModelConst.Gem:
                    {
                        _loc_7 = ModelConfig.instance.getInfoByType(_loc_9.itemInfo.type);
                        _loc_19 = _loc_9.itemInfo.color;
                        if (_loc_7)
                        {
                            _loc_4 = _loc_7["mesh" + (_loc_19 - 1)];
                            _loc_6 = _loc_7["texture" + (_loc_19 - 1)];
                        }
                        break;
                    }
                    case VipModelConst.TITLE:
                    {
                        break;
                    }
                    case VipModelConst.SKILL:
                    {
                        break;
                    }
                    case VipModelConst.advanceSystem:
                    {
                        break;
                    }
                    default:
                    {
                        break;
                    }
                }
                if (this.tween && this.tween.active)
                {
                    this.tween.kill();
                }
                if (_loc_3 == VipModelConst.Sprite)
                {
                    _loc_17 = _loc_7 as TModel;
                    this._bodyPlayer = FrObjectPool.getObject(WizardActionPlayer, this);
                    (this._bodyPlayer as ActionPlayer).load(_loc_4, _loc_5, _loc_6);
                    this._rect3d.addObject3d(this._bodyPlayer, 126 + 314, _loc_10);
                    (this._bodyPlayer as WizardActionPlayer).clearExtend();
                    (this._bodyPlayer as WizardActionPlayer).load(_loc_4, _loc_5, _loc_7.texture1, this._rect3d.renderList);
                    if (_loc_17.mesh2)
                    {
                        _loc_4 = _loc_17.mesh2 + ".md5mesh";
                        _loc_5 = _loc_17.bone2 + ".skeleton";
                        (this._bodyPlayer as WizardActionPlayer).loadExtend(_loc_4, _loc_5, _loc_17.texture2, this._rect3d.renderList);
                        (this._bodyPlayer as WizardActionPlayer).extendPlayer.timerContorler = this.timerContorler;
                    }
                    (this._bodyPlayer as ActionPlayer).play();
                    (this._bodyPlayer as ActionPlayer).scaleValue = _loc_11;
                    this._bodyPlayer.timerContorler = this.timerContorler;
                    this.timerContorler.active();
                }
                else if (_loc_3 == VipModelConst.Chlose)
                {
                    _loc_20 = ItemConfig.instance.getConfig((_loc_9.itemInfo as ItemEquipInfo).effect) as ItemEquipInfo;
                    this._roleModelPlayer = FrObjectPool.getObject(UserModelPlayer, this);
                    _loc_13 = Cache.instance.role.entityInfo.career;
                    _loc_14 = Cache.instance.role.entityInfo.sex;
                    _loc_15 = _loc_20 ? (_loc_20.modelId) : (0);
                    _loc_16 = 10;
                    this._roleModelPlayer.updateInfo(_loc_13, _loc_14, (_loc_9.itemInfo as ItemEquipInfo).modelId, 0, _loc_15, _loc_16, 0);
                    this._roleModelPlayer.scaleAll = _loc_11;
                    this._roleModelPlayer.rotationX = 0;
                    this._roleModelPlayer.rotationY = 0;
                    this._roleModelPlayer.useLight();
                    this._roleModelPlayer.setRenderList(this._rect3d.renderList);
                    this._rect3d.addObject3d(this._roleModelPlayer, 126 + 314, _loc_10);
                }
                else if (_loc_3 == VipModelConst.Wing)
                {
                    this._roleModelPlayer = FrObjectPool.getObject(UserModelPlayer, this);
                    _loc_13 = Cache.instance.role.entityInfo.career;
                    _loc_14 = Cache.instance.role.entityInfo.sex;
                    _loc_15 = 0;
                    _loc_16 = 0;
                    this._roleModelPlayer.updateIsShowEffect(true, true, true);
                    this._roleModelPlayer.updateInfo(_loc_13, _loc_14, Cache.instance.role.roleEntityInfo.clothes, 0, _loc_15, (_loc_9.itemInfo as ItemEquipInfo).modelId, _loc_16, Cache.instance.role.roleEntityInfo.isHideWing);
                    this._roleModelPlayer.scaleAll = _loc_11;
                    this._roleModelPlayer.rotationX = 0;
                    this._roleModelPlayer.rotationY = 0;
                    this._roleModelPlayer.useLight();
                    this._roleModelPlayer.setRenderList(this._rect3d.renderList);
                    this._rect3d.addObject3d(this._roleModelPlayer, 124 + 314, _loc_10);
                }
                else if (_loc_3 == VipModelConst.Weapon)
                {
                    this._bodyPlayer = FrObjectPool.getObject(ActionPlayer, this);
                    this._bodyPlayer.enabledPool = false;
                    (this._bodyPlayer as ActionPlayer).load(_loc_4, _loc_5, _loc_6);
                    this._bodyPlayer.timerContorler = this.timerContorler;
                    var _loc_34:* = _loc_11;
                    (this._bodyPlayer as ActionPlayer).scaleZ = _loc_11;
                    var _loc_34:* = _loc_34;
                    (this._bodyPlayer as ActionPlayer).scaleY = _loc_34;
                    (this._bodyPlayer as ActionPlayer).scaleX = _loc_34;
                    this._rect3d.addObject3d(this._bodyPlayer, 120 + 310, _loc_10);
                    if (_loc_12)
                    {
                        this._effectPlayer = EffectPlayerPool.instance.getEffectPlayer(_loc_7.selfEffect, this._bodyPlayer, this._rect3d.renderList, false);
                        this._effectPlayer.play(PlayMode.ANIMATION_LOOP_MODE);
                        if (this._effectPlayer.temple is TempleRole)
                        {
                            (this._effectPlayer.temple as TempleRole).setRoleParams(this._bodyPlayer, null, null);
                        }
                        this._bodyPlayer.rotationZ = -20;
                        this.tween = TweenMax.to(this._bodyPlayer, 0.01, {ease:Quint.easeIn, repeat:-1, onRepeat:this.modelTurn});
                    }
                    else
                    {
                        while (_loc_22 < 4)
                        {
                            
                            _loc_21 = EffectPlayerPool.instance.getEffectPlayer(_loc_7.selfEffect, this._bodyPlayer, this._rect3d.renderList, false);
                            _loc_21.play(PlayMode.ANIMATION_LOOP_MODE);
                            if (_loc_21.temple is TempleRole)
                            {
                                (_loc_21.temple as TempleRole).setRoleParams(this._bodyPlayer, null, null);
                            }
                            _loc_21.hangBoneName = "Bone00" + (2 * _loc_22 + 1);
                            (this._bodyPlayer as ActionPlayer).hang(_loc_21);
                            _loc_22++;
                        }
                        (this._bodyPlayer as ActionPlayer).changeAction(ActionName.Stand);
                        (this._bodyPlayer as ActionPlayer).play();
                    }
                    this.timerContorler.active();
                }
                else if (_loc_3 == VipModelConst.Gem)
                {
                    this._effectPlayer = EffectPlayerPool.instance.getEffectPlayer(ForgingConst.EffectPath4, null, this._rect3d.renderList, false);
                    this._effectPlayer.play(PlayMode.ANIMATION_LOOP_MODE);
                    this._mesPlayer = FrObjectPool.getObject(MeshPlayer, this);
                    this._mesPlayer.load(_loc_4 + ".mesh", _loc_6, this._rect3d.renderList);
                    this._mesPlayer.hangBoneName = BoneConst.MountHangModelBone;
                    this._effectPlayer.hang(this._mesPlayer, "parent1");
                    var _loc_34:* = _loc_11;
                    this._effectPlayer.scaleZ = _loc_11;
                    var _loc_34:* = _loc_34;
                    this._effectPlayer.scaleY = _loc_34;
                    this._effectPlayer.scaleX = _loc_34;
                    this._rect3d.addObject3d(this._effectPlayer, 126 + 314, _loc_10);
                }
                else if (_loc_3 == VipModelConst.TITLE)
                {
                    _loc_23 = TitleConfig.instance.getInfoById(_loc_8);
                    this._effectPlayer = EffectPlayerPool.instance.getEffectPlayer(_loc_23.icon, null, this._rect3d.renderList, false);
                    this._effectPlayer.play();
                    var _loc_34:* = _loc_11;
                    this._effectPlayer.scaleZ = _loc_11;
                    var _loc_34:* = _loc_34;
                    this._effectPlayer.scaleY = _loc_34;
                    this._effectPlayer.scaleX = _loc_34;
                    this._rect3d.addObject3d(this._effectPlayer, 120 + 314, _loc_10);
                }
                else if (_loc_3 == VipModelConst.SKILL)
                {
                    _loc_24 = SkillConfig.instance.getInfoById(_loc_8);
                    _loc_25 = SkillModelConfig.instance.getInfoById(_loc_24.skillModel);
                    this._effectPlayer = EffectPlayerPool.instance.getEffectPlayer(_loc_25.selfModel, null, this._rect3d.renderList, false);
                    this._effectPlayer.play();
                    var _loc_34:* = _loc_11;
                    this._effectPlayer.scaleZ = _loc_11;
                    var _loc_34:* = _loc_34;
                    this._effectPlayer.scaleY = _loc_34;
                    this._effectPlayer.scaleX = _loc_34;
                    this._rect3d.addObject3d(this._effectPlayer, 120 + 314, _loc_10);
                }
                else if (_loc_3 == VipModelConst.advanceSystem)
                {
                    if (_loc_8 == 1)
                    {
                        _loc_26 = Cache.instance.mount.mountData.mountLevel > 3 ? (Cache.instance.mount.mountData.mountLevel) : (3);
                        _loc_27 = MountConfig.instance.getMountInfoByCode(_loc_26);
                        _loc_7 = ModelConfig.instance.getInfoByCode(_loc_27.modelId);
                        _loc_28 = new Point(126 + 314, _loc_10);
                        if (_loc_26 == 10)
                        {
                            _loc_29 = 0;
                        }
                        else
                        {
                            _loc_29 = 50;
                        }
                        this._bodyPlayer = FrObjectPool.getObject(ActionPlayer, this);
                    }
                    else
                    {
                        switch(_loc_13)
                        {
                            case ECareer._ECareerWarrior:
                            {
                                break;
                            }
                            case ECareer._ECareerArcher:
                            {
                                break;
                            }
                            case ECareer._ECareerMage:
                            {
                                break;
                            }
                            default:
                            {
                                break;
                            }
                        }
                        if (_loc_8 == 3)
                        {
                        }
                        else if (_loc_8 == 4)
                        {
                        }
                        else if (_loc_8 == 5)
                        {
                        }
                    }
                    if (_loc_7 is TModel)
                    {
                        _loc_4 = _loc_7.mesh1 + ".md5mesh";
                        _loc_5 = _loc_7.bone1 + ".skeleton";
                        (this._bodyPlayer as ActionPlayer).load(_loc_4, _loc_5, _loc_7.texture1, this._rect3d.renderList);
                        (this._bodyPlayer as ActionPlayer).changeAction(ActionName.MountStand);
                        (this._bodyPlayer as ActionPlayer).scaleValue = _loc_11;
                        (this._bodyPlayer as ActionPlayer).play();
                        this._effectPlayer = EffectPlayerPool.instance.getEffectPlayer(_loc_7.effect1, this._bodyPlayer, this._rect3d.renderList, false);
                    }
                    else if (_loc_7 is TPlayerModel)
                    {
                        _loc_4 = _loc_7.mesh + ".md5mesh";
                        (this._bodyPlayer as WeaponPlayer).load(_loc_4, _loc_7.texture, this._rect3d.renderList);
                        (this._bodyPlayer as WeaponPlayer).rotationZ = -20;
                        var _loc_34:* = _loc_11;
                        (this._bodyPlayer as WeaponPlayer).scaleZ = _loc_11;
                        var _loc_34:* = _loc_34;
                        (this._bodyPlayer as WeaponPlayer).scaleY = _loc_34;
                        (this._bodyPlayer as WeaponPlayer).scaleX = _loc_34;
                        (this._bodyPlayer as WeaponPlayer).play();
                        this._effectPlayer = EffectPlayerPool.instance.getEffectPlayer(_loc_7.selfEffect, this._bodyPlayer, this._rect3d.renderList, false);
                        this.tween = TweenMax.to(this._bodyPlayer, 0.01, {ease:Quint.easeIn, repeat:-1, onRepeat:this.modelTurn});
                    }
                    this._bodyPlayer.rotationY = _loc_29;
                    this._rect3d.addObject3d(this._bodyPlayer, _loc_28.x, _loc_28.y);
                    if (this._effectPlayer.temple is TempleRole)
                    {
                        (this._effectPlayer.temple as TempleRole).setRoleParams(this._bodyPlayer, null, null);
                    }
                    this._effectPlayer.play(PlayMode.ANIMATION_LOOP_MODE);
                }
                if (_loc_7 is TModel && _loc_7.bone2)
                {
                    if (!this._hangPlayer)
                    {
                        this._hangPlayer = FrObjectPool.getObject(ActionPlayer, this);
                        this._hangPlayer.changeAction(ActionName.Stand);
                        this._hangPlayer.selectEnabled = true;
                        this._hangPlayer.play();
                    }
                    _loc_4 = _loc_7.mesh2 + ".md5mesh";
                    _loc_5 = _loc_7.bone2 + ".skeleton";
                    this._hangPlayer.load(_loc_4, _loc_5, _loc_7.texture2);
                    this._hangPlayer.alpha = 1;
                    this._hangPlayer.hangBoneName = BoneConst.ModelHangWingBone;
                    (this._bodyPlayer as ActionPlayer).hang(this._hangPlayer);
                }
            }
            return;
        }// end function

        private function modelTurn() : void
        {
            var _loc_1:* = this.turnNum + 0.05;
            this.turnNum = this.turnNum + 0.05;
            this._bodyPlayer.y = this._bodyPlayer.y + Math.cos(_loc_1) * 0.8;
            this._bodyPlayer.rotationY = this._bodyPlayer.rotationY + 2;
            return;
        }// end function

        private function getDataProvider() : DataProvider
        {
            var _loc_3:Object = null;
            var _loc_1:* = new DataProvider();
            var _loc_2:int = 0;
            while (_loc_2 < 10)
            {
                
                _loc_3 = {level:(_loc_2 + 1)};
                _loc_1.addItem(_loc_3);
                _loc_2++;
            }
            return _loc_1;
        }// end function

        private function changePrivilegeShow(event:MouseEvent) : void
        {
            if (event.target == this._descBtn)
            {
                this._picSprite.visible = !this._picSprite.visible;
                this._desc.visible = !this._desc.visible;
            }
            else if (event.target == this._vipCompaireBtn)
            {
                Dispatcher.dispatchEvent(new DataEvent(EventName.VipWinChangeTab, 2));
            }
            return;
        }// end function

        private function getItems(event:MouseEvent) : void
        {
            if ((this._tabBar.selectedIndex + 1) > Cache.instance.vip.level)
            {
                MsgManager.showRollTipsMsg(Language.getString(35592));
                return;
            }
            var _loc_2:* = new Object();
            if (this._getRewardBtn == event.target)
            {
                _loc_2.level = this._tabBar.selectedIndex + 1;
                _loc_2.type = EVipRecordType._EVipRecordTypeItemWelfare;
                _loc_2.fun = this.flyItemListToBackPack;
            }
            else if (this._dailyItemBtn == event.target)
            {
                _loc_2.level = Cache.instance.vip.level;
                _loc_2.type = EVipRecordType._EVipRecordTypeDailyGift;
                _loc_2.fun = this.flyDailyToBackPack;
            }
            Dispatcher.dispatchEvent(new DataEvent(EventName.VipGetReward, _loc_2));
            return;
        }// end function

        private function changeVipLevel() : void
        {
            var _loc_2:* = ((this._tabBar.selectedIndex + 1)).toString();
            this._vipLevelIcon3.text = ((this._tabBar.selectedIndex + 1)).toString();
            var _loc_2:* = _loc_2;
            this._vipLevelIcon2.text = _loc_2;
            this._vipLevelIcon1.text = _loc_2;
            var _loc_1:* = VipConfig.instance.getVipConfigByType(EVipRecordType._EVipRecordTypeTxtDesc);
            this._desc.htmlText = DescConfig.instance.getDescById(_loc_1["vip" + (this._tabBar.selectedIndex + 1)]);
            _loc_1 = VipConfig.instance.getVipConfigByType(47);
            this._prizeTxt1.htmlText = Language.getString(35593) + _loc_1["vip" + (this._tabBar.selectedIndex + 1)] + "</font>";
            _loc_1 = VipConfig.instance.getVipConfigByType(46);
            this._prizeTxt2.htmlText = Language.getString(35593) + _loc_1["vip" + (this._tabBar.selectedIndex + 1)] + "</font>";
            this.updateItemList();
            this.updateDailyItemList();
            this.updatePicList();
            this.updateRewardBtn();
            this.updateDailyBtn();
            this.updateDescBtn();
            this.update3DModel();
            return;
        }// end function

        private function createVipPic() : void
        {
            var _loc_1:int = 0;
            var _loc_2:VipPictureBox = null;
            while (_loc_1 < 4)
            {
                
                _loc_2 = UICompomentPool.getUICompoment(VipPictureBox);
                _loc_2.x = 33;
                _loc_2.y = _loc_1 * 80 + 249;
                this._picSprite.addChild(_loc_2);
                this.pushUIToDisposeVec(_loc_2);
                this._picList.push(_loc_2);
                _loc_1++;
            }
            return;
        }// end function

        private function createItemList() : void
        {
            var _loc_1:int = 0;
            var _loc_2:EffectItem = null;
            while (_loc_1 < 4)
            {
                
                _loc_2 = UICompomentPool.getUICompoment(EffectItem);
                _loc_2.setItemStyle(ItemStyleConst.Small, ImagesConst.PackItemBg, 2, 2);
                _loc_2.x = _loc_1 * 50 + 670;
                _loc_2.y = 371;
                _loc_2.isShowLock = true;
                _loc_2.isDragAble = false;
                _loc_2.isDropAble = false;
                this._itemSprite.addChild(_loc_2);
                this.pushUIToDisposeVec(_loc_2);
                this._itemList.push(_loc_2);
                _loc_1++;
            }
            return;
        }// end function

        private function updatePicList() : void
        {
            var _loc_3:int = 0;
            var _loc_1:* = VipConfig.instance.getVipConfigByType(EVipRecordType._EVipRecordTypeImgDesc);
            var _loc_2:* = _loc_1["vip" + (this._tabBar.selectedIndex + 1)].split("#");
            while (_loc_3 < _loc_2.length)
            {
                
                this._picList[_loc_3].data = _loc_2[_loc_3];
                if (this._picSprite.visible)
                {
                    this._picList[_loc_3].killTween();
                    CallLater.setCallLater(this._picList[_loc_3].showOver, _loc_3 * 0.13);
                }
                _loc_3++;
            }
            return;
        }// end function

        private function updateItemList() : void
        {
            var _loc_4:Array = null;
            var _loc_5:ItemData = null;
            var _loc_6:int = 0;
            var _loc_1:* = VipConfig.instance.getVipConfigByType(EVipRecordType._EVipRecordTypeItemWelfare);
            var _loc_2:* = ItemConfig.instance.getConfig(_loc_1["vip" + (this._tabBar.selectedIndex + 1)]) as ItemGiftBagInfo;
            this._levelRewardItem.itemData = new ItemData(_loc_2.code);
            var _loc_3:* = _loc_2.itemList1.split("&");
            while (_loc_6 < this._itemList.length)
            {
                
                if (_loc_6 > (_loc_3.length - 1))
                {
                    this._itemList[_loc_6].itemData = null;
                }
                else
                {
                    _loc_4 = _loc_3[_loc_6].split("#");
                    _loc_5 = new ItemData(int(_loc_4[1]));
                    if (_loc_5.itemInfo || ItemsUtil.isFitCarrer(_loc_5))
                    {
                        this._itemList[_loc_6].itemData = _loc_5;
                        (this._itemList[_loc_6] as EffectItem).amount = _loc_4[2];
                    }
                    else
                    {
                        this._itemList[_loc_6].itemData = null;
                    }
                }
                _loc_6++;
            }
            return;
        }// end function

        private function updateDailyItemList() : void
        {
            var _loc_4:Array = null;
            var _loc_5:ItemData = null;
            var _loc_6:int = 0;
            var _loc_7:EffectItem = null;
            this.clearDailyItem();
            var _loc_1:* = VipConfig.instance.getVipConfigByType(EVipRecordType._EVipRecordTypeDailyGift);
            var _loc_2:* = ItemConfig.instance.getConfig(_loc_1["vip" + (this._tabBar.selectedIndex + 1)]) as ItemGiftBagInfo;
            this._dailyRewardItem.itemData = new ItemData(_loc_2.code);
            var _loc_3:* = _loc_2.itemList1.split("&");
            while (_loc_6 < _loc_3.length)
            {
                
                _loc_4 = _loc_3[_loc_6].split("#");
                _loc_5 = new ItemData(int(_loc_4[1]));
                if (_loc_5.itemInfo || ItemsUtil.isFitCarrer(_loc_5))
                {
                    _loc_7 = UICompomentPool.getUICompoment(EffectItem);
                    _loc_7.setItemStyle(ItemStyleConst.Small, ImagesConst.PackItemBg, 2, 2);
                    _loc_7.x = _loc_6 * 50 + 670;
                    _loc_7.y = 540;
                    _loc_7.isShowLock = true;
                    _loc_7.isDragAble = false;
                    _loc_7.isDropAble = false;
                    this._itemSprite.addChild(_loc_7);
                    this._dailyList.push(_loc_7);
                    _loc_7.itemData = _loc_5;
                    _loc_7.amount = _loc_4[2];
                }
                _loc_6++;
            }
            return;
        }// end function

        private function clearDailyItem() : void
        {
            var _loc_1:EffectItem = null;
            for each (_loc_1 in this._dailyList)
            {
                
                _loc_1.dispose();
            }
            this._dailyList.length = 0;
            return;
        }// end function

        public function flyItemListToBackPack() : void
        {
            var _loc_1:EffectItem = null;
            var _loc_2:Point = null;
            for each (_loc_1 in this._itemList)
            {
                
                if (_loc_1.itemData)
                {
                    _loc_2 = _loc_1.localToGlobal(new Point(0, 0));
                    FlyToNavbarTool.flyToBackPack(_loc_1.bitmapdata, _loc_2);
                }
            }
            return;
        }// end function

        private function flyDailyToBackPack() : void
        {
            var _loc_1:EffectItem = null;
            var _loc_2:Point = null;
            for each (_loc_1 in this._dailyList)
            {
                
                if (_loc_1.itemData)
                {
                    _loc_2 = _loc_1.localToGlobal(new Point(0, 0));
                    FlyToNavbarTool.flyToBackPack(_loc_1.bitmapdata, _loc_2);
                }
            }
            return;
        }// end function

        private function tabBarChangeHandler(event:Event = null) : void
        {
            this._currentIndex = this._tabBar.selectedIndex;
            this.changeVipLevel();
            return;
        }// end function

        public function updeteVipLevel() : void
        {
            this.updateRewardBtn();
            this._tabBar.dataProvider = this.getDataProvider();
            return;
        }// end function

        public function updateRewardBtn() : void
        {
            EffectManager.glowFilterUnReg(this._getRewardBtn);
            if (Cache.instance.vip.getRewardDic[(this._tabBar.selectedIndex + 1)])
            {
                this._getRewardBtn.enabled = false;
                this._getRewardBtn.label = Language.getString(35594);
                this._getRewardBtn.filters = [FilterConst.colorFilter2];
            }
            else if (!Cache.instance.vip.getRewardDic[(this._tabBar.selectedIndex + 1)] && (this._tabBar.selectedIndex + 1) <= Cache.instance.vip.level)
            {
                this._getRewardBtn.enabled = true;
                this._getRewardBtn.label = Language.getString(35595);
                this._getRewardBtn.filters = [];
                EffectManager.glowFilterReg(this._getRewardBtn);
            }
            else
            {
                this._getRewardBtn.enabled = false;
                this._getRewardBtn.label = Language.getString(35592);
                this._getRewardBtn.filters = [FilterConst.colorFilter2];
            }
            return;
        }// end function

        public function updateDailyBtn() : void
        {
            var _loc_1:int = 0;
            var _loc_2:int = 0;
            EffectManager.glowFilterUnReg(this._dailyItemBtn);
            if ((this._tabBar.selectedIndex + 1) == Cache.instance.vip.level)
            {
                _loc_1 = Cache.instance.vip.getVipFreeTimesByType(EVipRecordType._EVipRecordTypeDailyGift);
                _loc_2 = 1 - _loc_1;
                if (_loc_2)
                {
                    this._dailyItemBtn.label = Language.getString(35595);
                    this._dailyItemBtn.enabled = true;
                    EffectManager.glowFilterReg(this._dailyItemBtn);
                    this._dailyItemBtn.filters = [];
                }
                else
                {
                    this._dailyItemBtn.label = Language.getString(35594);
                    this._dailyItemBtn.enabled = false;
                    this._dailyItemBtn.filters = [FilterConst.colorFilter2];
                }
            }
            else if ((this._tabBar.selectedIndex + 1) > Cache.instance.vip.level)
            {
                this._dailyItemBtn.enabled = false;
                this._dailyItemBtn.label = Language.getString(35592);
                this._dailyItemBtn.filters = [FilterConst.colorFilter2];
            }
            else if ((this._tabBar.selectedIndex + 1) < Cache.instance.vip.level)
            {
                this._dailyItemBtn.label = Language.getString(35596);
                this._dailyItemBtn.enabled = false;
                this._dailyItemBtn.filters = [FilterConst.colorFilter2];
            }
            return;
        }// end function

        public function updateDescBtn() : void
        {
            this._descBtn.htmlText = Language.getStringByParam(35597, (this._tabBar.selectedIndex + 1));
            return;
        }// end function

    }
}
